package com.pinyuana.dragongame.utils

import android.Manifest
import android.os.Build
import java.util.ArrayList

object PermissionUtils {
    private val PERMISSION_MANIFEST = arrayOf(
        Manifest.permission.RECORD_AUDIO,
        Manifest.permission.READ_PHONE_STATE,
        Manifest.permission.WRITE_EXTERNAL_STORAGE,
        Manifest.permission.READ_EXTERNAL_STORAGE,
        Manifest.permission.CAMERA
    )

    private val PERMISSION_MANIFEST33 = arrayOf(
        Manifest.permission.RECORD_AUDIO,
        Manifest.permission.READ_PHONE_STATE,
        Manifest.permission.CAMERA
    )

    fun getPermissions(): ArrayList<String> {
        return if (Build.VERSION.SDK_INT < Build.VERSION_CODES.TIRAMISU) {
            ArrayList(PERMISSION_MANIFEST.toList())
        } else {
            ArrayList(PERMISSION_MANIFEST33.toList())
        }
    }
}